﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<div id="wflist">
    <p>
        流程列表</p>
    <div id="tabs">
        <ul>
            <% using (System.Data.DataTable dt_wftype = ViewData["dt_wftype"] as System.Data.DataTable)
               {

                   for (int j = 0; j < dt_wftype.Rows.Count; j++)
                   { %>
            <li><a href="#tabs-<%=j %>">
                <%=dt_wftype.Rows[j]["名称"]%></a></li>
            <%}
               } %>
        </ul>
        <%
            using (System.Data.DataTable dt_wftype = ViewData["dt_wftype"] as System.Data.DataTable)
            {
                for (int j = 0; j < dt_wftype.Rows.Count; j++)
                {
        %>
        <div id="tabs-<%=j %>">
            <table>
                <tr>
                    <th>
                        编码
                    </th>
                    <th>
                        名称
                    </th>
                    <th>
                        创建时间
                    </th>
                    <th>
                        创建人
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                <%
                    System.Data.DataTable dt_wf = ViewData["dt_wf"] as System.Data.DataTable;
                    for (int i = 0; i < dt_wf.Rows.Count; i++)
                    {
                        if (dt_wf.Rows[i]["类型编码"].ToString() == dt_wftype.Rows[j]["编码"].ToString())
                        {
                %>
                <tr>
                    <td>
                        <%=dt_wf.Rows[i]["编码"]%>
                    </td>
                    <td>
                        <%=dt_wf.Rows[i]["名称"]%>
                    </td>
                    <td>
                        <%=dt_wf.Rows[i]["创建时间"]%>
                    </td>
                    <td>
                        <%=dt_wf.Rows[i]["创建人"]%>
                    </td>
                    <td>
                        <%=Ajax.ActionLink("发起", "WFStart", new { wf_id = dt_wf.Rows[i]["编码"], user_id = ViewData["user_id"] }, new AjaxOptions { UpdateTargetId = "workarea", OnSuccess = "intityUserTree_WF" })%>
                    </td>
                </tr>
                <%
                    }
                    } %>
            </table>
        </div>
        <%}
            } %>
    </div>
</div>
